/**
 * Copyright (c) 2016-2019 人人开源 All rights reserved.
 *
 * https://www.renren.io
 *
 * 版权所有，侵权必究！
 */

package io.volunteer.common.validator;

import io.volunteer.common.exception.RRException;
import org.apache.commons.lang.StringUtils;

/**
 * 数据校验
 *
 * @author Mark sunlightcs@gmail.com
 */
public abstract class Assert {

    /**
    * @Description: TODO 字符串检测
    * @Param: [str, message]
    * @return: void
    * @Author: WillemGavin
    * @Date: 2021/3/28 22:47
    */
    public static void isBlank(String str, String message) {
        if (StringUtils.isBlank(str)) {
            throw new RRException(message);
        }
    }

    /**
    * @Description: TODO 对象检测
    * @Param: [object, message]
    * @return: void
    * @Author: WillemGavin
    * @Date: 2021/3/28 22:47
    */
    public static void isNull(Object object, String message) {
        if (object == null) {
            throw new RRException(message);
        }
    }
}
